<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>knet: 线程</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">knet
   &#160;<span id="projectnumber">1.4.3</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="modules.html"><span>模块</span></a></li>
      <li><a href="annotated.html"><span>类</span></a></li>
      <li><a href="files.html"><span>文件</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">函数</a>  </div>
  <div class="headertitle">
<div class="title">线程</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:gac20d7726e152e0b49209ce228893c25d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__thread.html#gac20d7726e152e0b49209ce228893c25d">thread_runner_create</a> (thread_func_t func, void *params)</td></tr>
<tr class="separator:gac20d7726e152e0b49209ce228893c25d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8b9d3d45b6055971fc40f24ec6572cf6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__thread.html#ga8b9d3d45b6055971fc40f24ec6572cf6">thread_runner_destroy</a> (<a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *runner)</td></tr>
<tr class="separator:ga8b9d3d45b6055971fc40f24ec6572cf6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1114fd962e310f9d31ed4e83d8a21897"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__thread.html#ga1114fd962e310f9d31ed4e83d8a21897">thread_runner_start</a> (<a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *runner, int stack_size)</td></tr>
<tr class="separator:ga1114fd962e310f9d31ed4e83d8a21897"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa035f190ffd3d7f117b8fbb58716f042"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__thread.html#gaa035f190ffd3d7f117b8fbb58716f042">thread_runner_stop</a> (<a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *runner)</td></tr>
<tr class="separator:gaa035f190ffd3d7f117b8fbb58716f042"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga93f88ba77e7eab786da6fe7d1f681a2e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__thread.html#ga93f88ba77e7eab786da6fe7d1f681a2e">thread_runner_start_loop</a> (<a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *runner, <a class="el" href="struct__loop__t.html">loop_t</a> *loop, int stack_size)</td></tr>
<tr class="separator:ga93f88ba77e7eab786da6fe7d1f681a2e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9191991e2bd7f91fe68324c2855d581d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__thread.html#ga9191991e2bd7f91fe68324c2855d581d">thread_runner_start_timer_loop</a> (<a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *runner, <a class="el" href="struct__ktimer__loop__t.html">ktimer_loop_t</a> *timer_loop, int stack_size)</td></tr>
<tr class="separator:ga9191991e2bd7f91fe68324c2855d581d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga813a718c56e0923be9396630c8460794"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__thread.html#ga813a718c56e0923be9396630c8460794">thread_runner_join</a> (<a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *runner)</td></tr>
<tr class="separator:ga813a718c56e0923be9396630c8460794"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga95c00ec3d6ef1710cc8d8bb8cb7e585d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__thread.html#ga95c00ec3d6ef1710cc8d8bb8cb7e585d">thread_runner_check_start</a> (<a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *runner)</td></tr>
<tr class="separator:ga95c00ec3d6ef1710cc8d8bb8cb7e585d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf67fa2b2cfefc2de422a31b9dfad2bca"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__thread.html#gaf67fa2b2cfefc2de422a31b9dfad2bca">thread_runner_get_params</a> (<a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *runner)</td></tr>
<tr class="separator:gaf67fa2b2cfefc2de422a31b9dfad2bca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaecf10907eee00ec0e807271c906a6645"><td class="memItemLeft" align="right" valign="top">thread_id_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__thread.html#gaecf10907eee00ec0e807271c906a6645">thread_get_self_id</a> ()</td></tr>
<tr class="separator:gaecf10907eee00ec0e807271c906a6645"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabddf3ac30aac3f22f8c53b7517e6eb35"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__thread.html#gabddf3ac30aac3f22f8c53b7517e6eb35">thread_sleep_ms</a> (int ms)</td></tr>
<tr class="separator:gabddf3ac30aac3f22f8c53b7517e6eb35"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa187b2cd2c906680890fb4ea2833d665"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__thread.html#gaa187b2cd2c906680890fb4ea2833d665">thread_set_tls_data</a> (<a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *runner, void *data)</td></tr>
<tr class="separator:gaa187b2cd2c906680890fb4ea2833d665"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga63c9be5b8fb04c0b26382f51b7bdf237"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__thread.html#ga63c9be5b8fb04c0b26382f51b7bdf237">thread_get_tls_data</a> (<a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *runner)</td></tr>
<tr class="separator:ga63c9be5b8fb04c0b26382f51b7bdf237"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gade4f41f1cd519f2719b5114ce7801232"><td class="memItemLeft" align="right" valign="top">atomic_counter_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__thread.html#gade4f41f1cd519f2719b5114ce7801232">atomic_counter_inc</a> (atomic_counter_t *counter)</td></tr>
<tr class="separator:gade4f41f1cd519f2719b5114ce7801232"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafc2df03d75cf9168b72e8c5e11953437"><td class="memItemLeft" align="right" valign="top">atomic_counter_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__thread.html#gafc2df03d75cf9168b72e8c5e11953437">atomic_counter_dec</a> (atomic_counter_t *counter)</td></tr>
<tr class="separator:gafc2df03d75cf9168b72e8c5e11953437"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga141897cac9743394a99ff7780daa6a80"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__thread.html#ga141897cac9743394a99ff7780daa6a80">atomic_counter_zero</a> (atomic_counter_t *counter)</td></tr>
<tr class="separator:ga141897cac9743394a99ff7780daa6a80"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<pre>
线程</pre><pre>线程API提供了基本的线程相关操作:</pre><pre>1. 线程建立销毁
2. TLS
3. 原子操作</pre><pre>thread_runner_start_loop可以直接以loop_t作为参数在线程内运行loop_run
thread_runner_start_timer_loop可以直接以ktimer_loop_t作为参数在线程内运行ktimer_loop_run</pre><pre></pre> <h2 class="groupheader">函数说明</h2>
<a class="anchor" id="gafc2df03d75cf9168b72e8c5e11953437"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">atomic_counter_t atomic_counter_dec </td>
          <td>(</td>
          <td class="paramtype">atomic_counter_t *&#160;</td>
          <td class="paramname"><em>counter</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>原子操作 - 递减 </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">counter</td><td>atomic_counter_t实例 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>递减后的值 </dd></dl>

</div>
</div>
<a class="anchor" id="gade4f41f1cd519f2719b5114ce7801232"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">atomic_counter_t atomic_counter_inc </td>
          <td>(</td>
          <td class="paramtype">atomic_counter_t *&#160;</td>
          <td class="paramname"><em>counter</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>原子操作 - 递增 </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">counter</td><td>atomic_counter_t实例 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>递增后的值 </dd></dl>

</div>
</div>
<a class="anchor" id="ga141897cac9743394a99ff7780daa6a80"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int atomic_counter_zero </td>
          <td>(</td>
          <td class="paramtype">atomic_counter_t *&#160;</td>
          <td class="paramname"><em>counter</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>原子操作 - 是否为零 </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">counter</td><td>atomic_counter_t实例 </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>非零 </td></tr>
    <tr><td class="paramname">其他</td><td>零 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaecf10907eee00ec0e807271c906a6645"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">thread_id_t thread_get_self_id </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>取得线程ID </p><dl class="section return"><dt>返回</dt><dd>线程ID </dd></dl>

</div>
</div>
<a class="anchor" id="ga63c9be5b8fb04c0b26382f51b7bdf237"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* thread_get_tls_data </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *&#160;</td>
          <td class="paramname"><em>runner</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>取得线程本地存储 </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">runner</td><td>thread_runner_t实例 </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>获取失败或不存在 </td></tr>
    <tr><td class="paramname">有效指针</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga95c00ec3d6ef1710cc8d8bb8cb7e585d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int thread_runner_check_start </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *&#160;</td>
          <td class="paramname"><em>runner</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>检查线程是否正在运行 </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">runner</td><td>thread_runner_t实例 </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>未运行 </td></tr>
    <tr><td class="paramname">非零</td><td>正在运行 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gac20d7726e152e0b49209ce228893c25d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct__thread__runner__t.html">thread_runner_t</a>* thread_runner_create </td>
          <td>(</td>
          <td class="paramtype">thread_func_t&#160;</td>
          <td class="paramname"><em>func</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>params</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>创建一个线程 </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">func</td><td>线程函数 </td></tr>
    <tr><td class="paramname">params</td><td>参数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>thread_runner_t实例 </dd></dl>

</div>
</div>
<a class="anchor" id="ga8b9d3d45b6055971fc40f24ec6572cf6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void thread_runner_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *&#160;</td>
          <td class="paramname"><em>runner</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>销毁一个线程 </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">runner</td><td>thread_runner_t实例 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaf67fa2b2cfefc2de422a31b9dfad2bca"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* thread_runner_get_params </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *&#160;</td>
          <td class="paramname"><em>runner</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>取得线程运行参数，thread_runner_create()第二个参数 </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">runner</td><td>thread_runner_t实例 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>线程运行参数 </dd></dl>

</div>
</div>
<a class="anchor" id="ga813a718c56e0923be9396630c8460794"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void thread_runner_join </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *&#160;</td>
          <td class="paramname"><em>runner</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>等待线程终止 </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">runner</td><td>thread_runner_t实例 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga1114fd962e310f9d31ed4e83d8a21897"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int thread_runner_start </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *&#160;</td>
          <td class="paramname"><em>runner</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>stack_size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>启动线程 </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">runner</td><td>thread_runner_t实例 </td></tr>
    <tr><td class="paramname">stack_size</td><td>线程栈大小（字节） </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">error_ok</td><td>成功 </td></tr>
    <tr><td class="paramname">其他</td><td>失败 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga93f88ba77e7eab786da6fe7d1f681a2e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int thread_runner_start_loop </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *&#160;</td>
          <td class="paramname"><em>runner</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct__loop__t.html">loop_t</a> *&#160;</td>
          <td class="paramname"><em>loop</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>stack_size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>在线程内运行loop_run() </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">runner</td><td>thread_runner_t实例 </td></tr>
    <tr><td class="paramname">loop</td><td>loop_t实例 </td></tr>
    <tr><td class="paramname">stack_size</td><td>线程栈大小（字节） </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">error_ok</td><td>成功 </td></tr>
    <tr><td class="paramname">其他</td><td>失败 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga9191991e2bd7f91fe68324c2855d581d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int thread_runner_start_timer_loop </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *&#160;</td>
          <td class="paramname"><em>runner</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct__ktimer__loop__t.html">ktimer_loop_t</a> *&#160;</td>
          <td class="paramname"><em>timer_loop</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>stack_size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>在线程内运行timer_loop_run() </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">runner</td><td>thread_runner_t实例 </td></tr>
    <tr><td class="paramname">timer_loop</td><td>ktimer_loop_t实例 </td></tr>
    <tr><td class="paramname">stack_size</td><td>线程栈大小（字节） </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">error_ok</td><td>成功 </td></tr>
    <tr><td class="paramname">其他</td><td>失败 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaa035f190ffd3d7f117b8fbb58716f042"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void thread_runner_stop </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *&#160;</td>
          <td class="paramname"><em>runner</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>停止线程 </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">runner</td><td>thread_runner_t实例 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaa187b2cd2c906680890fb4ea2833d665"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int thread_set_tls_data </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct__thread__runner__t.html">thread_runner_t</a> *&#160;</td>
          <td class="paramname"><em>runner</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>设置线程本地存储 </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">runner</td><td>thread_runner_t实例 </td></tr>
    <tr><td class="paramname">data</td><td>自定义数据指针 </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>返回值</dt><dd>
  <table class="retval">
    <tr><td class="paramname">error_ok</td><td>成功 </td></tr>
    <tr><td class="paramname">其他</td><td>失败 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gabddf3ac30aac3f22f8c53b7517e6eb35"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void thread_sleep_ms </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>ms</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>睡眠 </p><dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">ms</td><td>睡眠时间（毫秒） </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
生成于 2015年 七月 9日 星期四 14:59:53 , 为 knet使用  &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
